//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.liqy.api.domain;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

public class Response<T> implements Serializable {
	private static final long serialVersionUID = 1L;
	private int resultCode;
	private String tipMsg;
	private String resultString;
	private List<T> resultList;
	private Object data;

	public Response() {
	}

	public static <T> Response<T> errResponse(String msg) {
		Response<T> rObj = new Response<T>();
		rObj.setResultCode(1);
		rObj.setTipMsg(msg);
		return rObj;
	}

	public static <T> Response<T> successResponse(String msg) {
		Response<T> rObj = new Response<T>();
		rObj.setResultCode(0);
		rObj.setTipMsg(msg);
		return rObj;
	}

	public static <T> Response<T> successResponse(String msg, Object Response) {
		Response<T> rObj = new Response<T>();
		rObj.setResultCode(0);
		rObj.setTipMsg(msg);
		rObj.setData(Response);
		return rObj;
	}

	public static <T> Response<T> successResponse(Object Response) {
		Response<T> rObj = new Response<T>();
		rObj.setResultCode(0);
		rObj.setTipMsg("doSuccess");
		rObj.setData(Response);
		return rObj;
	}

	public static <T> Response<T> successResponse() {
		Response<T> rObj = new Response<T>();
		rObj.setResultCode(0);
		rObj.setTipMsg("doSuccess");
		return rObj;
	}

	public int getResultCode() {
		return this.resultCode;
	}

	public void setResultCode(int resultCode) {
		this.resultCode = resultCode;
	}

	public String getTipMsg() {
		return this.tipMsg;
	}

	public void setTipMsg(String tipMsg) {
		this.tipMsg = tipMsg;
	}

	public String getResultString() {
		return this.resultString;
	}

	public void setResultString(String resultString) {
		this.resultString = resultString;
	}

	public List<T> getResultList() {
		return this.resultList;
	}

	public void setResultList(List<T> resultList) {
		this.resultList = resultList;
	}

	public Object getData() {
		return this.data;
	}

	public void setData(Object Response) {
		this.data = Response;
	}

	public static Response<Map<String, Object>> errResponse(String resultString, String tipMsg) {
		Response<Map<String, Object>> rObj = new Response<>();
		rObj.setResultCode(1);
		rObj.setResultString(resultString);
		rObj.setTipMsg(tipMsg);
		return rObj;
	}

	public boolean isSuccess() {
		if (this.resultCode == 0) {
			return true;
		} else
			return false;
	}
}
